<?php
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2006~2018 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st <liu21st@gmail.com>
// +----------------------------------------------------------------------
use think\facade\Route;

Route::group('admin', function () {
    //登录
    Route::post('login', '\app\admin\controller\LoginController@login');
    // 找回密码
    Route::post('find_password', '\app\admin\controller\AdminController@findPassword');

    //需要登录
    Route::group(function () {
        // 用户
        // 登录用户信息
        Route::post('get_info','\app\admin\controller\AdminController@getInfo');
        // 修改密码
        Route::post('modify_password','\app\admin\controller\AdminController@modifyPassword');
        // 退出登录
        Route::post('logout','\app\admin\controller\LoginController@logout');

        // 猪厂
        // 列表
        Route::get('factory/list', '\app\admin\controller\FactoryController@list');
        // 新增
        Route::post('factory/add', '\app\admin\controller\FactoryController@add');
        // 详情
        Route::get('factory/detail', '\app\admin\controller\FactoryController@detail');
        // 下拉选择
        Route::get('factory/select_list', '\app\admin\controller\FactoryController@selectList');

        // 猪栋
        // 列表
        Route::get('barn/list', '\app\admin\controller\BarnController@list');
        // 详情
        Route::get('barn/detail', '\app\admin\controller\BarnController@detail');
        // 下拉选择
        Route::get('barn/select_list', '\app\admin\controller\BarnController@selectList');

        //上位机版本
        //新增
        Route::post('machine_version/add', '\app\admin\controller\MachineVersionController@add');
        //列表
        Route::get('machine_version/list', '\app\admin\controller\MachineVersionController@getList');
        //删除
        Route::post('machine_version/del', '\app\admin\controller\MachineVersionController@del');
        //版本关联机器
        Route::post('machine_version/machine', '\app\admin\controller\MachineVersionController@machine');

        // 上位机
        // 下拉列表
        Route::get('machine/pull', '\app\admin\controller\MachineController@getPull');
        // 列表
        Route::get('machine/list', '\app\admin\controller\MachineController@list');

        // 疾病分类
        // 列表
        Route::get('disease_category/list', '\app\admin\controller\DiseaseCategoryController@list');
        // 新增
        Route::post('disease_category/add', '\app\admin\controller\DiseaseCategoryController@add');
        // 删除
        Route::post('disease_category/del', '\app\admin\controller\DiseaseCategoryController@del');
        
    })->middleware(['check_admin_login']);

});
